﻿@model VIT.Pre.HealthCare.Models.IcdModel

@{
    ViewBag.Title = "Phòng khám online";
    Layout = "~/Views/Shared/_MainLayout.cshtml";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset class="patientinfo">
        <legend>Thông tin bệnh</legend>
        <table>
            <tr>
                <td class="title">
                    @Html.LabelFor(model => model.Code)
                </td>
                <td class="value"><b>@Html.DisplayFor(model => model.Code)</b></td>
            </tr>
        </table>
        
        <table>
            <tr>
                <td class="title">
                    @Html.LabelFor(model => model.Description)
                </td>
                <td class="value"><b>@Html.DisplayFor(model => model.Description)</b></td>
            </tr>
        </table>
        
        <table>
            <tr>
                <td class="title">
                    @Html.LabelFor(model => model.Active):
                </td>
                <td class="value check"><b>@Html.DisplayFor(model => model.Active)</b></td>
            </tr>
        </table>
    </fieldset>
}

<fieldset class="patientlist">
    <legend>Danh sách bệnh</legend>
    <form action="/Settings/Icd" method="GET">
        <table width="100%">
            <tr>
                <td><input id='search' name="skey" type="text" style="width: 100%;height: 19px;"/> </td>
                <td style="padding-left:10px" class="btnSearch"><input name="" type="submit" value="Tìm"/></td>                  
            </tr>
        </table>
    </form>
    <table class="table" width="100%" border="0" cellspacing="0" cellpadding="0">
        <thead>
            <tr>
                <td>Mã bệnh</td>
                <td>Mô tả</td>
                <td style="width: 52px">Sử dụng</td>
            </tr>
        </thead>
        
        @foreach (var o in Model.Icds)
        {
            var active = o.Active ? "Y" : "N";
            <tr onclick="window.location.assign('/Settings/Icd?code=@o.Code&skey=@Request["skey"]')">
                <td>@o.Code</td>
                <td>@o.Description</td>
                <td style="text-align: center">@active</td>
            </tr>
        }
    </table>
 </fieldset>

